package com.boot;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用 postman 发送 POST请求到 http://localhost:8080/loggers/com.boot
 * 其中请求体Body内容为：
{
 "configuredLevel": "DEBUG"
 }
 *
 * 将日志级别调整为DEBUG
 */
@RestController
@SpringBootApplication
public class Learn426ModifyLogLevelApplication {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @RequestMapping(value = "/test", method = RequestMethod.GET)
    public String testLogLevel() {
        logger.debug("Logger Level ：DEBUG");
        logger.info("Logger Level ：INFO");
        logger.error("Logger Level ：ERROR");
        return "";
    }


	public static void main(String[] args) {
		SpringApplication.run(Learn426ModifyLogLevelApplication.class, args);
	}
}
